package com.whmnx.home.ui.model;


import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;

import com.whmnx.home.BR;
import com.whmnx.home.R;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.tatarka.bindingcollectionadapter2.ItemBinding;

/**
 *
 * @author goldze
 * @date 2018/7/18
 */

public class ViewPagerHomeItemViewModel extends ItemViewModel<HomeModel> {
    public String text;

    public ViewPagerHomeItemViewModel(@NonNull HomeModel viewModel, String text) {
        super(viewModel);
        this.text = text;
        for (int i = 0; i < 10; i++) {
            observableList.add(new HomeItemViewModel(viewModel));
        }
    }

    //给RecyclerView添加ObservableList
    public ObservableList<HomeItemViewModel> observableList = new ObservableArrayList<>();
    //给RecyclerView添加ItemBinding
    public ItemBinding<HomeItemViewModel> itemBinding = ItemBinding.of(BR.viewModel, R.layout.item_home);

}
